import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'default',
      component: resolve => require(['../components/dashboard'], resolve),
      // redirect: {name: 'login'}
      redirect: {name: '数据地图'}
    },
    {
      path: '/login',
      name: 'login',
      component: resolve => require(['../components/login'], resolve)
    },
    {
      path: '/dashboard',
      name: 'dashboard',
      component: resolve => require(['../components/dashboard'], resolve),
      // redirect: '/dashboard/home',
      children: [
        {
          path: 'home',
          name: 'home',
          component: resolve => require(['../components/home'], resolve),
          // redirect: '../components/DataMapManagement/DataMap',
        },
        // {
        //   path: 'DataMap',
        //   name: '数据地图',
        //   component: resolve => require(['../components/DataMapManagement/DataMap'], resolve),
        // },
        {
          path: 'MetaModelManagement/:metaMedelData',
          name: '元模型',
          component: resolve => require(['../components/MetaModelManagement/MetaModelManagement'], resolve),
          children: [
            {
              path: 'Relational/Table',
              name: 'RelationalTable',
              component: resolve => require(['../components/MetaModelManagement/RelationalMetaModel/TableMetaModel'], resolve)
            },
            {
              path: 'Relational/Column',
              name: 'RelationalColumn',
              component: resolve => require(['../components/MetaModelManagement/RelationalMetaModel/ColumnMetaModel'], resolve)
            }
            ,
            {
              path: 'ETLMetaModel/ColumnMap',
              name: 'ETLMetaModel/ColumnMap',
              component: resolve => require(['../components/MetaModelManagement/ETLMetaModel/ColumnMap'], resolve)
            }
          ]
        },
        {
          path: 'SystemManagement',
          name: '系统管理',
          component: resolve => require(['../components/SystemManagement/SystemManagement'], resolve),
          children: [
          {
            path: 'System',
            name: '系统',
            component: resolve => require(['../components/SystemManagement/System'], resolve)
          },
          ]
        },
        {
           path: 'DataMapManagement',
           name: '数据地图管理',
           component: resolve => require(['../components/DataMapManagement/DataMapManagement'], resolve),
           children: [
             {
               path: 'DataMap',
               name: '数据地图',
               component: resolve => require(['../components/DataMapManagement/DataMap'], resolve),
             }
           ]
         },
        {
          path: 'MetaDataCollectManagement',
          name: '元数据采集管理',
          component: resolve => require(['../components/MetaDataCollectManagement/MetaDataCollectManagement'], resolve),
          children: [
            {
              path: 'DataSource',
              name: '元数据采集',
              component: resolve => require(['../components/MetaDataCollectManagement/DataSource'], resolve)
            },
          ]
        },
        {
          path: 'MetaDataManagement',
          name: '元数据管理',
          component: resolve => require(['../components/MetaDataManagement/MetaDataManagement'], resolve),
          children: [
            {
              path: 'MetaData',
              name: '元数据',
              component: resolve => require(['../components/MetaDataManagement/MetaData'], resolve)
            },
          ]
        },
        {
          path: 'ETLTaskManagement',
          name: 'ETL任务管理',
          component: resolve => require(['../components/ETLTaskManagement/ETLTaskManagement'], resolve),
          children: [
            {
              path: 'ETLTask',
              name: 'ETL任务',
              component: resolve => require(['../components/ETLTaskManagement/ETLTask'], resolve)
            },
          ]
        },
      ]
    }
  ]

})
